<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page isELIgnored="false"%>
<%@ include file="../common/taglibs.jsp"%>
<%
    String path = request.getContextPath();
			String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
					+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>

<title>商户信息变更申请查询</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<link href="<s:url value="/css/common.css"/>" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="<c:url value="/js/jquery-1.3.2.js" />"></script>
<script type="text/javascript" src="<c:url value="/js/common.js" />"></script>
<script language="javascript" type="text/javascript"
	src="<c:url value="/js/My97DatePicker/WdatePicker.js"/>"></script>

<style>
</style>

<script type="text/javascript">

	$(document).ready(function() {
		$("#query").click(function() {
			if(!checkDate()){
		    	return false;
		    }
			$("#queryUserForm").attr("action","<%=basePath%>/merinfoChangeQuery/queryMerinfo.ct");
			$("#queryUserForm").submit();
		});	
		$("#exportQuery").click(function() {
			if(!exportCheckDate()){
		    	return false;
		    }
			$("#queryUserForm").attr("action","<%=basePath%>/merinfoChangeQuery/excelMerinfoChangeC2List.ct");
			$("#queryUserForm").submit();
		});
		
		<%-- 	$("#check").click(
						function() {
							var dd = $("input[name=multi_sel]:checked");
							if(dd.length != 1){
								alert("只能选择一个商户进行设置！");
								return false;
							}
							var type=$("#merinfoChangeTyep").find('option:selected').val();
							var id = dd.val();
							if(dd.length == 0){
								alert("请选择商户");
								return false;
							}else{
							
							    $("#queryUserForm").attr("action","<%=basePath%>/merinfoChangeCheck/check.ct?merinfo.id=" + id);
								$("#queryUserForm").submit();
								return false;

							}

						}); --%>
   });
	
	function str2date(str){
		var d=null;   
		var reg=/^(\d{4})(\d{2})(\d{2})$/  ;
		if(arr=str.match(reg)){
			d = new Date(Number(arr[1]),Number(arr[2])-1,Number(arr[3])) ; 
		}
		return d;   
	} 
	function  checkDate(){
		var endTime = $("#maxDate").val();
		
		var beginTime = $("#minDate").val();
		var date1=str2date(beginTime);
		var date2=str2date(endTime);
		if(date2 != null && date1 == null){
			alert("填写完整是时间范围");
			return false;
		}
		if(date1 != null && date2 == null){
			alert("填写完整是时间范围");
			return false;
		}
/* 		if(endTime.length > 0 && beginTime.length > 0 && beginTime == endTime){
			alert("时间不能选择同一天,至少相隔一天");
			return false;
		} */
		if(date1.getMonth()!=date2.getMonth()){
		    alert("选择的起始时间不在同一个月内！");
			return false;
		}
		return true;
	}
	function  exportCheckDate(){
		var endTime = $("#maxDate").val();
		
		var beginTime = $("#minDate").val();
		var date1=str2date(beginTime);
		var date2=str2date(endTime);
		
		if(date2 != null && date1 == null){
			alert("填写完整是时间范围");
			return false;
		}
		if(date1 != null && date2 == null){
			alert("填写完整是时间范围");
			return false;
		}
		if(date2 == null && date1 == null){
			alert("请选择审核通过时间范围");
			return false;
		}
/* 		if(endTime.length > 0 && beginTime.length > 0 && beginTime == endTime){
			alert("时间不能选择同一天,至少相隔一天");
			return false;
		} */
		if(date1.getMonth()!=date2.getMonth()){
		    alert("选择的起始时间不在同一个月内！");
			return false;
		}
		return true;
	}
	function isDetail(str){
		$("#queryUserForm").attr("action","<%=basePath%>/merinfoChangeQuery/queryById.ct?merinfoChange.id="+str);
		$("#queryUserForm").submit();
	}
</script>



</head>

<body>
<s:form id="queryUserForm" action="/merinfoChangeQuery/queryMerinfo.ct" method="post" theme="simple">
	<table class="tb">
		<tr class="tb-line">
	    	<td class="tb-td" colspan="6"><div class="tb-h2">POS收单运营管理平台</div> </td>
	    </tr>
	   	<tr class="tb-line">
	        <td class="tb-td" colspan="6"><div class="tb-h3">商户信息变更查询列表</div></td>
	    </tr>
		<tr class="tb-line">
			<td align="right" class="tb-td">
                <div class="tb-h4">
					商户号：
				</div>
			</td>
			<td class="tb-td">
					<label class="tb-input-normal">
						<s:textfield name="searchCondition.merchantNo"/>
					</label>
			</td>
			<td align="right" class="tb-td">
                <div class="tb-h4">
					证件号：
				</div>
			</td>
			<td class="tb-td">
	            <label class="tb-input-normal">
					<s:textfield id="cardNo" name="searchCondition.cardNo" />
				</label>
			</td>

		</tr>
		<tr class="tb-line">
			<td align="right" class="tb-td">
                <div class="tb-h4">
					商户简称：
				</div>
			</td>
			<td class="tb-td">
            	<label class="tb-input-normal">
					<s:textfield id="accountNo" name="searchCondition.nameBusi" cssClass="queryWidth" />
				</label>
			</td>
			<td align="right" class="tb-td">
                <div class="tb-h4">
					工商注册名称：
				</div>
			</td>
			<td class="tb-td">
            	<label class="tb-input-normal">
					<s:textfield id="realName" name="searchCondition.name"  />
				</label>
			</td>
		</tr >
		<tr class="tb-line">
			<td align="right" class="tb-td">
                <div class="tb-h4">
					审核结果：
				</div>
			</td>
			<td class="tb-td">
				 <label class="tb-input-mini">
                	<s:select list="#{'99':'请选择状态','N':'审核未通过','Y':'审核通过','L':'领件未审核','W':'未审核' }" name="searchCondition.status" />
               	</label>
			</td>
			<td align="right" class="tb-td">
				<div class="tb-h4">
					审核时间：
				</div>
			</td>
			<td class="tb-td" >
					<label class="tb-input-normal">
						<s:textfield id="minDate" onfocus="WdatePicker({dateFmt:'yyyyMMdd',readOnly:true,wdate:true,errDealMode:0});"    name="searchCondition.minDate"  />
					</label>
						-
					<label class="tb-input-normal">
						<s:textfield id="maxDate" onfocus="WdatePicker({dateFmt:'yyyyMMdd',readOnly:true,wdate:true,errDealMode:0});"   name="searchCondition.maxDate"   />
					</label>
		    </td>
		</tr>
		<tr class="tb-line">
			<s:if test="#session.session_merchant.roleType==\"03\"||#session.session_merchant.roleType==\"15\" || #session.session_merchant.roleType==\"16\"">
				<td width="12%" style="min-width: 150px" align="right" class="tb-td">
	                <div class="tb-h4">商户信息变更类型：</div>
	            </td>
				<td class="tb-td">
					<label class="tb-select">
					<s:select id="merinfoChangeTyep"
							name="searchCondition.dealCode"
							list="#{'C9':'变更商户等级','C1':'申请变更基本信息','C2':'申请变更结算信息','C3':'商户增机申请','C4':'申请变更T1手续费','C5':'申请变更T0手续费','C6':'商户申请T1开通','C7':'商户申请T0开通','C8':'终止合同申请','10':'商户申请银联扫码支付开通','11':'商户申请支付宝/微信扫码支付开通','12':'商户申请预授权开通' }"
							headerKey="99" headerValue="--请选择--" cssClass="queryWidth" />
					</label>
				</td>
				<td align="right" width="15%"></td>
				<td>
					<s:hidden name="searchCondition.orgCode" value="%{#session.session_merchant.orgCode}" />
				</td>
			</s:if>
			<s:else>
				<td width="12%" style="min-width: 150px" align="right" class="tb-td">
	                <div class="tb-h4">所属机构：</div>
	            </td>
				<td class="tb-td">
					<label class="tb-select">
						<s:select  name="searchCondition.orgCode" list="#request.orgList" listKey="InsIdCd" listValue="InsName" />
					</label>
				</td>
				
				<td width="12%" style="min-width: 150px" align="right" class="tb-td">
	                <div class="tb-h4">商户信息变更类型：</div>
	            </td>
				<td class="tb-td">
					<label class="tb-select">
						<s:select id="merinfoChangeTyep"
						name="searchCondition.dealCode"
						list="#{'C1':'申请变更基本信息','C2':'申请变更结算信息','C3':'商户增机申请','C4':'申请变更T1手续费','C5':'申请变更T0手续费','C6':'商户申请T1开通','C7':'商户申请T0开通','C8':'终止合同申请' ,'10':'商户申请银联扫码支付开通','11':'商户申请支付宝/微信扫码支付开通','12':'商户申请预授权开通' }"
						headerKey="99" headerValue="--请选择--" cssClass="queryWidth" />
					</label>
				</td>
			</s:else>
		</tr>
		   <tr class="tb-line" >
				<td class="tb-td" colspan="6" align="center">
					<div style="color: red;">
						<s:actionmessage />
					</div>
					<div style="color: red;">
						<s:actionerror />
					</div>
				</td>
		   </tr>
		<tr class="tb-line">
            <td class="tb-td line-submit" align="right" colspan="6">
                <label class="tb-input-submit">
					<s:submit id="query" value="查 询" />
				</label>
				<label class="tb-input-submit">
					<s:reset value="取 消" />
				</label>
				<s:if test="#session.session_merchant.roleType==\"00\" || #session.session_merchant.roleType==\"13\" || #session.session_merchant.roleType==\"12\"">
					<s:if test="#request.searchRsList != null && #request.searchRsList.size>0">
						<label class="tb-input-submit">
							<input id="exportQuery" value="导出Excel" type="submit" />
			       		</label>
			       	</s:if>
			       	<s:else>
			       		<label class="tb-input-submit">
							<input id="exportQuery" disabled="disabled"  value="导出Excel" type="submit" />
			       		</label>
			       	</s:else>
		        </s:if>
			</td>
		</tr>
	</table>
	<div class="big-tb">
		<table class="tb" style="width: 100%;">
			<thead>
				<tr class="tb-line">
                		<th class="tb-th" colspan="16">商户基本信息列表</th>
          		</tr>
				<s:if test="#request.searchRsList != null && #request.searchRsList.size>0">
					<tr class="tb-line">
						<td class="tb-td paging" align="left" colspan="16">
							<page:pageCount
								max_pages="11" totalPage="${requestScope.totalPage}"
								currentPage="${requestScope.currentPage}"
								action="${rootPath}/merinfoChangeQuery/queryMerinfo.ct?currentPage=" />

						</td>
					</tr>
				</s:if>
				<tr class="tb-line bg-gray">
					<th class="tb-th">变更类型</th>
					<th class="tb-th">商户号</th>
					<th class="tb-th">商户简称</th>
					<th class="tb-th">工商注册名</th>
					<th class="tb-th">所属机构</th>
					<th class="tb-th">所属代理商</th>
					<th class="tb-th">业务联系人</th>
					<th class="tb-th">业务联系人电话</th>
					<th class="tb-th">法人代表</th>
					<th class="tb-th">法人代表证件号码</th>
					<th class="tb-th">申请变更时间</th>
					<th class="tb-th">审核时间</th>
					<th class="tb-th">商户地址</th>
					<th class="tb-th">审核员</th>
					<th class="tb-th">审核意见</th>
					<th class="tb-th">审核结果</th>
					<!-- <th class="tb-th">操作</th> -->
				</tr>
			</thead>
			<tbody >
				<s:iterator value="#request.searchRsList" status="stat" id="sh">
					<tr class="tb-line">
						<td class="tb-td">
							<s:if test="#sh.dealCode==\"C1\"">申请变更基本信息</s:if> 
							<s:elseif test="#sh.dealCode==\"C2\"">申请变更结算信息</s:elseif> 
							<s:elseif test="#sh.dealCode==\"C3\"">商户增机申请</s:elseif> 
							<s:elseif test="#sh.dealCode==\"C4\"">申请变更T1手续费</s:elseif> 
							<s:elseif test="#sh.dealCode==\"C5\"">申请变更T0手续费</s:elseif> 
							<s:elseif test="#sh.dealCode==\"C6\"">商户申请T1开通</s:elseif> 
							<s:elseif test="#sh.dealCode==\"C7\"">商户申请T0开通</s:elseif> 
							<s:elseif test="#sh.dealCode==\"C8\"">终止合同</s:elseif>
							<s:elseif test="#sh.dealCode==\"C9\"">变更商户等级</s:elseif> 
							<s:elseif test="#sh.dealCode==\"C10\"">法人对私账户改对公账户</s:elseif>
							<s:elseif test="#sh.dealCode==\"10\"">商户申请银联扫码支付开通</s:elseif> 
							<s:elseif test="#sh.dealCode==\"11\"">商户申请支付宝/微信扫码支付开通</s:elseif>
							<s:elseif test="#sh.dealCode==\"12\"">商户申请预授权开通</s:elseif>
						</td >
						<td class="tb-td">
							<a href="javascript:isDetail(<s:property value="#sh.id"/>)"><s:property value="#sh.mid"/></a>
						</td>
						<td class="tb-td">
							<s:property value="#sh.nameBusi" />
						</td>
						<td class="tb-td">
							<s:property value="#sh.name" />
						</td>
						<td class="tb-td">
							<s:property value="#sh.merKind" />
						</td>
						<td class="tb-td">
							<s:property value="#sh.agentId" />
						</td>
						<td class="tb-td">
							<s:property value="#sh.contactName" />
						</td>
						<td class="tb-td">
							<s:property value="#sh.contactPhoneNo" />
						</td>
						<td class="tb-td">	
							<s:property value="#sh.certif" />
						</td>
						<td class="tb-td">	
							<s:property value="#sh.certifNo" />
						</td>
						<td class="tb-td">
							<s:property value="#sh.dtCreateTime" />
						</td>
						<td class="tb-td">
							<s:property value="#sh.dtAuditorTime" />
						</td>
						<td class="tb-td">
							<s:property value="#sh.regAddr" />
						</td>
						<td class="tb-td">
							<s:property value="#sh.operators" />
						</td>
						<td class="tb-td">
							<s:property value="#sh.remark" />
						</td>

						<td class="tb-td">
							<!--<s:if test="#sh.status==\"F\"">信息不完善(复审)</s:if>-->
							<s:if test="#sh.status==\"N\"">审核未通过</s:if>
							<s:elseif test="#sh.status==\"Y\"">审核通过</s:elseif> <!--<s:elseif test="#sh.status==\"I\"">信息不完善(初审)</s:elseif>-->
							<s:elseif test="#sh.status==\"L\"">领件未审核</s:elseif>
							<s:elseif test="#sh.status==\"W\"">待审核</s:elseif> <s:else></s:else>
						</td>
						<%-- <td class="tb-td" align="center">
							<!--<s:if test="#sh.status==\"F\"||#sh.status==\"I\"">
					        <s:a href="editMerinfo.ct?merinfoChange.mid=%{#sh.mid}&merinfoChange.id=%{#sh.id}">修改</s:a>
					        </s:if>-->
							<s:if test="#sh.status==\"Y\"">
								<s:a href="queryById.ct?merinfoChange.mid=%{#sh.mid}&merinfoChange.id=%{#sh.id}">详情</s:a>
							</s:if>
						</td> --%>
					</tr>
				</s:iterator>
			</tbody>
		</table>
	<s:if test="#request.msg !=null">
		<script language="javascript">
			alert("${request.msg}");
		</script>
	</s:if>
	</s:form>
</body>
</html>
